﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using VB.BusinessLogic.Services;
using VB.Common.Constants;
using VB.BusinessLogic.Models;
using VBBlog.Models;
using VB.Common.Extensions;

namespace VBBlog.Controllers
{
    public class HomeController : Controller
    {
        //
        // GET: /Index/

        public ActionResult Index()
        {
            List<Article> articles = ArticleService.Istance.GetTopNewArticles(Constants.HomePageArticlesQuantity);

            HomeModel model = new HomeModel() 
            {
                Articles = articles
            };

            return View(model);
        }

    }
}
